package com.lecture.java8.multithreading.callable;

import java.util.concurrent.Callable;

/**
 * @author luyn
 * @version 1.0
 * @description
 * @date 2021/1/15 15:12
 */
public class CallableTest2 implements Callable<Integer> {
    @Override
    public Integer call() throws Exception {
        int sum = 0;
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName() + ":" +i);
            sum += i;
        }
        return sum;
    }
}